package com.share.dao.sysmgr.privilege;

import java.util.List;

import org.springframework.stereotype.Component;

import com.share.bean.sysmgr.privilege.PrivilegeRole;
import com.share.commons.base.dao.BaseDaoSupport;


@Component("privilegeRoleDao")
public class PrivilegeRoleDaoImpl extends BaseDaoSupport<PrivilegeRole> implements PrivilegeRoleDao{

	@Override
	public void deleteRoleDao(int id) throws RuntimeException {
		
		this.deleteObject(this.queryByIdRoleDao(id)) ;
	}

	@Override
	public PrivilegeRole queryByIdRoleDao(int id) throws RuntimeException {
		
		return (PrivilegeRole) this.getById(PrivilegeRole.class, id) ;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<PrivilegeRole> queryRoleDao(String hql) throws RuntimeException {
		
		return (List<PrivilegeRole>) this.find(hql) ;
	}

	@Override
	public void saveRoleDao(PrivilegeRole role) throws RuntimeException {
		this.saveObject(role) ;
	}

	@Override
	public void updateRoleDao(PrivilegeRole role) throws RuntimeException {
		this.updateObject(role) ;
	}

}
